public class CoAuthorNetwork {
//  public static String FIELD_ = "physics:gr-qc";
  public static String FIELD_ = "physics:hep-th";
//  public static String COMMUNITY_NET_FILE = "/home/sarfaraz/proj/grqc_run1_1/Arxiv-grqc-run1_1-coauthors_giant.net";
  public static String COMMUNITY_NET_FILE = "/home/sarfaraz/proj/hep-th_run1_1/Arxiv-hep-th_run1_1-coauthors_giant.net";

  private static AuthorParser ap_;
  
  public static enum SortParam {
    DATESTAMP,
    DEGREE,
  }
  
  public static void main(String[] args) {
    try {
      /*
      ap_ = new AuthorParser(Author.VERY_HIGH_DATE);
      ap_.parseAuthors();
      ap_.process(SortParam.DATESTAMP);
      
//      ap_.writeDateStampToFile("/home/sarfaraz/proj/gen/grqc/dts.net");
      ap_.writeDateStampToFile("/home/sarfaraz/proj/gen/hepth/dts.net");
      */
      
      int date = 19950101;
      
      while (date <= 20110101) {
        ap_ = new AuthorParser(date);
        ap_.parseAuthors();
        ap_.process(SortParam.DEGREE);
        
//        ap_.dumpDegreeDistr(String.format("/home/sarfaraz/proj/gen/grqc/%d.deg", date));
        ap_.dumpDegreeDistr(String.format("/home/sarfaraz/proj/gen/hepth/%d.deg", date));
        
        int d = date % 100;
        int m = (date / 100) % 100;
        int y = (date / 10000);
        
        m += 4;
        if (m > 12) {
          m %= 12;
          y++;
        }
        
        date = y * 10000 + m * 100 + d;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }  
  }

}
